package com.example.mongo.utils;



import net.sf.json.JSONArray;
import net.sf.json.JSONObject;



public class Json {

    public static JSONObject ObjToJson(Object object){
        if (null !=object) {
            JSONObject json = JSONObject.fromObject(object);
            return json;
        }
        return null;
    }

    public static JSONArray ArrayToJson(Object object){
        if (null !=object) {
            JSONArray jsonArray = JSONArray.fromObject(object);
            return jsonArray;
        }
        return null;
    }




}
